package cn.com.cetccst.basiccollection;

import org.json.JSONObject;

public class Collector {

    protected IBasicInfoOwner mStaticInfoOwner;
    protected InfoType mName;

    public Collector(IBasicInfoOwner owner, InfoType name) {
        mStaticInfoOwner = owner;
        mName = name;
    }

    public String collect() {
        if (mStaticInfoOwner == null) {
            return new JSONObject().toString();
        }
        return mStaticInfoOwner.collect(mName);
    }

    public String getName() {
        return mName.name();
    }

    public long timestamp() {
        return System.currentTimeMillis();
    }


}
